<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Mei/tuoList')}">托管辅导列表</a></li>
        <li><a href="{:url('Mei/tuoAdd')}">添加托管辅导</a></li>
        <li class="active"><a href="{:url('Mei/tuoCate')}">添加托管辅导类别</a></li>
    </ul>
    <table class="table table-hover table-bordered table-list col-sm-2" style="width: 16.66666667%;margin-top: 15px;">
        <tr><td><b>已添加托管辅导类别：</b></td></tr>
        <volist name="cate" id="cate">
            <tr><td>{$cate.name}
                <a style="float: right" href="javascript:;" onclick="del({$cate.id},'jia_cate');">删除</a>
            </td></tr>
        </volist>
    </table>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20 col-sm-10" action="{:url('Mei/jiacateSave')}">
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>托管辅导类别名称:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="name" value="">
            </div>
        </div>
        <input type="hidden" name="type" value="tuo">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang("SAVE")}</button>
        </div>
    </form>

</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function del(id,table) {
        layer.confirm('是否删除？删除之后无法恢复', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:"{:url('Mei/del')}",
                data:{'id':id,'table':'jia_cate'},
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg,{icon: 6,time: 1000},function () {
                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }
</script>
</body>
</html>